﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DynaBoard
{

    public class SearchResult
    {
        public readonly int? Page;
        public readonly int Pages;
        public readonly Thread[] Results;

        public SearchResult(int? page, int pages, Thread[] results)
        {
            if (page < 1)
            {
                throw new ArgumentOutOfRangeException("page");
            }

            if (pages < 0)
            {
                throw new ArgumentOutOfRangeException("pages");
            }

            if (pages == 0 && results.Length != 0)
            {
                throw new ArgumentException();
            }

            this.Page = page;
            this.Pages = pages;
            this.Results = results;
        }
    }

}
